package cn.kasa.basic.mapper;

import cn.kasa.basic.query.BasicQuery;
import cn.kasa.org.domain.Department;


import java.util.List;

public interface BaseMapper<T> {
    /*
     * @Title: loadAll
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:54
     * @Parameters:
     * @Return
     */
    // 查询所有
    List<T> loadAll();

    /*
     * @Title: loadById
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:54
     * @Parameters:
     * @Return
     */
    // 根据Id查询
    T loadById(Long id);

    /*
     * @Title: remove
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:54
     * @Parameters:
     * @Return
     */
    // 根据Id删除
    void remove(Long id);

    /*
     * @Title: save
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:54
     * @Parameters:
     * @Return
     */
    // 新增
    void save(T t);

    /*
     * @Title: update
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 修改
    void update(T t);

    /*
     * @Title: queryData
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 分页+高级查询
    List<T> queryData(BasicQuery basicQuery);

    /*
     * @Title: queryCount
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 查询总条数
    Integer queryCount(BasicQuery basicQuery);

    void batchRemove(Long[] ids);

    List<Department> tree();

}
